<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
    <meta name="renderer" content="webkit">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="description" content="College of Architecture and Urban Planning Tongji University">
    <meta name="author" content="CAUP">
    <title>College of Architecture and Urban Planning Tongji University</title>
    <link rel="icon" href="<?php echo base_url();?>static/images/favicon.ico">
    <link rel="shortcut" href="<?php echo base_url();?>static/images/favicon.ico">
    <link href="<?php echo base_url();?>static/css/bootstrap.min.css" rel="stylesheet">
    <link href="<?php echo base_url();?>static/css/caup.css" rel="stylesheet">
    <link href="<?php echo base_url();?>static/css/swiper.min.css" rel="stylesheet">

</head>

<body>
    <script type="text/javascript">
        if (!document.addEventListener) {
            // for IE6~IE8
            document.write('<script src="js/third/iebetter-1.0.3.min.js"><\/script>');
            // <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
            // <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
            document.write('<link href="css/caup.ie.css" rel="stylesheet">');
            document.write('<script src="http://cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"><\/script>');
            document.write('<script src="http://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"><\/script>');
            document.write('<div class="alert alert-warning"> You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</div>');
        }
    </script>

    <script type="text/javascript" src="<?php echo base_url();?>/static/js/third/jquery-1.10.1.min.js"></script>
    <script type="text/javascript" src="<?php echo base_url();?>/static/js/third/bootstrap.min.js"></script>
    <script type="text/javascript" src="<?php echo base_url();?>/static/js/third/jquery.swiper-3.0.8.min.js"></script>
    <script type="text/javascript" src="<?php echo base_url();?>/static/js/pub/config.js"></script>
    <script>
    $(function (){
        var search_web = $('form[name=searchs]');
      search_web.submit(function (){
        var ok = false;
        var message = $.trim($('input[name=keys]').val());
        // alert(message);
        if(message == '' || message == 'SEARCH NOW'){
          return false; 
        }
        else
        {
            return true;
        }
        return false; 
       })
    })

    </script>
<style type="text/css" media="screen">
    #billboard {z-index: 0}
</style>
    <nav class="navbar navbar-default navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="<?php echo base_url(); ?>">
                    <img class="logo" src="<?php echo base_url();?>static/images/logo-white.png" title="College of Architecture and Urban Planning Tongji University" alt="College of Architecture and Urban Planning Tongji University" />
                    <img class="describe" src="<?php echo base_url();?>static/images/title-white.png" />
                </a>
            </div>
            <?php 
               $tmpData = $this->db->select('cid,pid,catname,cattype')->get('category')->result_array();
               $categorys = channelLevel($tmpData);
             ?>
            <div id="navbar" class="navbar-collapse collapse">
                <ul class="nav navbar-nav navbar-main navbar-right">
                    <?php if(! empty($tmpData) && is_array($categorys)): ?>
                    <?php foreach ($categorys as $k => $v):?>
                        <li class="dropdown">
                            <?php $catName = strtolower(str_replace(' ', '', $v['catname'])) ?>
                            <a href="<?php echo site_url($catName) ?>" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><?php echo $v['catname'] ?></a>
                            <ul class="dropdown-menu">
                                <?php if(! empty($v['data'])): ?>
                                <?php foreach ($v['data'] as $ke => $va) { ?>
                                    <?php $catNameChild = strtolower(str_replace(' ', '', $va['catname'])); ?>
                                    <li><a 
                                        <?php if(empty($va['data'])  && $va['cattype'] == 1){ ?> 
                                            href="<?php echo site_url($catName.'/article/'.$va['cid']) ?>" 
                                        <?php }else if(empty($va['data'] ) && $va['cattype'] == 2){ ?>
                                            href="<?php echo site_url($catName.'/'.$catNameChild) ?>" 
                                        <?php }else{ ?>
                                            href="javascript:;"
                                        <?php } ?>
                                        ><?php echo $va['catname']; ?></a></li>

                                    <?php if(! empty($va['data'])): ?>
                                        <?php foreach ($va['data'] as $key => $val) {?>
                                            <?php $catNameChild2 = strtolower(str_replace(' ', '', $val['catname'])); ?>
                                            <li><a
                                             <?php if(empty($val['data'])  && $val['cattype'] == 1){ ?> 
                                                 href="<?php echo site_url($catName.'/article/'.$val['cid']) ?>" 
                                             <?php }else if(empty($val['data'] ) && $val['cattype'] == 2){ ?>
                                                 href="<?php echo site_url($catName.'/'.$catNameChild2) ?>" 
                                             <?php }else{ ?>
                                                 href="javascript:;"
                                             <?php } ?>
                                             class='parent'><?php echo ' &nbsp;&nbsp;- '.$val['catname']; ?></a></li>
                                        <?php } ?>
                                    <?php endif; ?>
                                <?php } ?>
                                <?php endif; ?>
                            </ul>
                        </li>
                    <?php endforeach; ?>
                    <?php endif; ?>

                </ul>
                <ul class="nav navbar-nav language">
                    <li>
                    <!-- search s-->
                        <form action="<?php echo site_url('home/search');?>" method="get" target='_blank' name='searchs' accept-charset="utf-8">
                            <input type="text" placeholder="SEARCH NOW" class="search" name="keys" value="" />
                        </form>
                     <!-- search end-->
                    </li>
                    <li><a href="http://www.tongji-caup.org/" target="_blank" class="lan-cn">中文版</a></li>
                </ul>
            </div>
            <!--/.nav-collapse -->
        </div>
    </nav>
<!-- navigation end -->